package com.itheima.jobs;


import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;
import org.springframework.stereotype.Component;



import java.util.Date;


@Component
public class ClearOrderSettingJob {

    @Reference
    private OrderSettingService orderSettingService;

    public void ClearOrderSetting() throws Exception {
        String date = DateUtils.parseDate2String(new Date());
        orderSettingService.delOrderSettingByDate(date);
        System.out.println("过期预约已清理");
    }

}
